package main.Q2601_2700;

public class Q2631_2640 {
    public static void main(String[] args) {
        System.out.println("Question2631：");
        System.out.println("Question2632：");
        System.out.println("Question2633：");
        System.out.println("Question2634：");
        System.out.println("Question2635：");
        System.out.println("Question2636：");
        System.out.println("Question2637：");
        System.out.println("Question2638：");
        System.out.println("Question2639：");
        System.out.println("Question2640：一个数组所有前缀的分数");
    }
}

class Question2640 {
    public long[] findPrefixScore(int[] nums) {
        long[] result = new long[nums.length], temp = new long[nums.length];
        long max = nums[0], total = 0;
        for (int i = 0; i < nums.length; i++) {
            max = Math.max(max, nums[i]);
            temp[i] = max + nums[i];
            result[i] = total + temp[i];
            total += temp[i];
        }
        return result;
    }
}